LLDP: add IEEE 802.1Q and 802.1AX org-specific TLVs - #4970
Conversation
|
Thanks for the PR. Could you please check if it is possible to add interoperability tests with existing tools or libraries, such as lldpd, to the unit tests. |
Hi Nils, by interoperability tests you mean: Making a real environment -> capturing everything -> writing tests based on the pcaps to make sure it gets parsed correctly? Like the last test ( |
|
No, those tests are also important, but if possible I have something like this in mind. Start lldpd with a certain configuration in a subprocess, In this way we can automatically verify the interaction with a real world application/libray. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4970 +/- ##
===========================================
- Coverage 80.49% 47.52% -32.97%
===========================================
Files 390 372 -18
Lines 96770 96558 -212
===========================================
- Hits 77891 45894 -31997
- Misses 18879 50664 +31785
🚀 New features to boost your workflow:
|
|
LGTM, but the doc tests fail with |
0c153b2 to
8e2d6e7
Compare
|
Regarding the interoperability tests, it doesn't matter if not all IDs are supported. At least we get an overall good coverage on AI generated code. |
…rg-specific dispatch AI-Assisted: yes (Claude Sonnet 4.6)
8e2d6e7 to
bc7e272
Compare
|
@polybassa I added interoperability tests for LLDP (via While writing the tests I also found a bug in
I also made the regression tests to not fail when IPython is missing. (the change in PoC for the hang - tested with Python 3.12.3 (affected) and 3.14.6 (not affected): """
POC: UTScapy (scapy.autorun) hangs forever when a test raises, on affected
"""
import sys
def check_python():
v = sys.version_info
affected = (v[:2] == (3, 12) and v[2] < 10) or (v[:2] == (3, 13) and v[2] < 3)
print(f"Python {sys.version.split()[0]} -- affected by gh-130250: {affected}")
return affected
def demo_cpython_bug():
"""Reproduce CPython gh-130250 standalone (no scapy)."""
import io
import traceback
try:
raise RuntimeError("boom")
except RuntimeError:
sys.last_exc = sys.exc_info()[1]
sys.last_type = type(sys.last_exc)
sys.last_value = sys.last_exc
sys.last_traceback = sys.last_exc.__traceback__
buf = io.StringIO()
try:
traceback.print_last(file=buf)
print("no error -- Python is fixed")
except AttributeError as e:
print(f"reproduced gh-130250: {e!r}")
def demo_scapy_hang():
"""Trigger the full UTScapy hang path."""
from scapy.autorun import autorun_get_interactive_session
cmds = "assert False, 'boom'\n"
print("calling autorun_get_interactive_session -- hangs on affected Python")
out, res = autorun_get_interactive_session(cmds, timeout=5)
print("returned:", repr(res))
if __name__ == "__main__":
check_python()
demo_cpython_bug()
demo_scapy_hang() |
+ Emulate interact test to work without IPython installed AI-Assisted: yes (Claude Opus 4.7)
bc7e272 to
5e824af
Compare
Hi everyone,
This PR adds 15 new org-specific TLVs for IEEE 802.1Q:
First, I wanted to implement only the ones that I needed (VLAN stuff), but then decided to implement all of them.
The code has been written mostly by AI. I've reviewed and corrected every line of it.